<%@ page contentType="text/html; charset=UTF-8"%>
<%@include file="/html/portlet/chart/datasourcecfg/init.jsp"%>


<%
String eventName = ParamUtil.getString(request, "eventName", "selectDscfg");
%>
<portlet:defineObjects />
<portlet:renderURL var="portletURL">
		<portlet:param name="mvcPath" value="/html/portlet/chart/datasourcecfg/select_dscfg.jsp" />
		<portlet:param name="eventName" value="<%= eventName %>" />
</portlet:renderURL>

<aui:form action="<%= portletURL.toString() %>" method="post" name="selectDscfgFm">
<liferay-ui:search-container>
	<liferay-ui:search-container-results
		results="<%=DataSourceCfgLocalServiceUtil.getDataSourceCfgs(searchContainer.getStart(), searchContainer.getEnd())%>"
		total="<%= DataSourceCfgLocalServiceUtil.getDataSourceCfgsCount() %>" />
	
	<liferay-ui:search-container-row
		className="cn.shuto.liferay.plugin.chart.service.model.DataSourceCfg"
		keyProperty="dataSourceId" modelVar="dscfg" escapedModel="<%=true%>">
		<liferay-ui:search-container-column-text name="chart.dsconfig.id"
					property="dataSourceId"/>
		<liferay-ui:search-container-column-text name="name"
			property="name" />
		<liferay-ui:search-container-column-text name="description"
			property="description"/>
		<liferay-ui:search-container-column-date name="modified-date" property="modifiedDate"/>
		<liferay-ui:search-container-column-text name="author" property="userName"/>
		<liferay-ui:search-container-column-date name="create-date" property="createDate"/>
		
			<liferay-ui:search-container-column-text>
					<%
					Map<String, Object> data = new HashMap<String, Object>();

					data.put("datasourceid", dscfg.getDataSourceId());
					data.put("name", dscfg.getName());
					%>

					<aui:button cssClass="selector-button" data="<%= data %>" value="choose" />
			</liferay-ui:search-container-column-text>
	</liferay-ui:search-container-row>

	
	<liferay-ui:search-iterator />
</liferay-ui:search-container>
</aui:form>
<aui:script use="aui-base">
	Liferay.Util.selectEntityHandler('#<portlet:namespace />selectDscfgFm', '<%= HtmlUtil.escapeJS(eventName) %>');
</aui:script>